package com.ceres.system.filter;

public class UrlFilter {

    //所有需要传递令牌的地址
    public static String filterPath="/oauth/admin/logout,/api/customer/**,/api/custUser/**,/api/custRole/**,/api/custMenu/**,/api/crops/**,/api/facility/**,/api/facilityInfo/**,/api/admin/**,/api/role/**,/api/menu/**";
    public static boolean hasAuthorize(String url){

        String[] split = filterPath.replace("**", "").split(",");

        for (String value : split) {

            if (url.startsWith(value)){
                return true; //代表当前的访问地址是需要传递令牌的
            }
        }

        return false; //代表当前的访问地址是不需要传递令牌的
    }
}
